load("@io_bazel_rules_go//proto:def.bzl", "go_proto_library")
load("//build:build_defs.bzl", "go_proto_checkedin_test")

# gazelle:exclude build.gen.pb.go

go_proto_checkedin_test(
    src = "build.gen.pb.go",
)

genrule(
    name = "copy_and_fix",
    srcs = ["@io_bazel//src/main/protobuf:srcs"],
    outs = ["build.proto"],
    cmd = "SRCS=($(locations @io_bazel//src/main/protobuf:srcs));" +
          "cp $$(dirname $$SRCS)/build.proto $@",
)

proto_library(
    name = "blaze_query_proto",
    srcs = ["build.proto"],
    visibility = ["//visibility:public"],
)

go_proto_library(
    name = "go_default_library",
    importpath = "github.com/bazelbuild/buildtools/build_proto",
    proto = ":blaze_query_proto",
    visibility = ["//visibility:public"],
)
